import request from '@/util/request'

// 登录
export function login(data) {
  return request({
    url: `/app/vote/login/login`,
    method: 'post',
    data
  })
}

// 获取 活动列表
export function getContestList() {
  return request({
    url: `/app/vote/contest/getContestAllList`,
    method: 'get'
  })
}

// 获取 房间列表
export function getRoomList() {
  return request({
    url: `/app/vote/room/getRoomList`,
    method: 'get'
  })
}

// ================ 赛羊 相关 ===============

// 获取 房间中的 当前 羊
export function getCurrentSheep(roomId) {
  return request({
    url: `/app/vote/sheep/currentSheep?roomId=${roomId}`,
    // url: `/app/vote/comm/currentSheep?roomId=${roomId}`,
    method: 'get'
  })
}

// 提交 羊 评分
export function saveSheepScore(data) {
  return request({
    url: `/app/vote/sheep/saveSheepScore`,
    method: 'post',
    data
  })
}

// 获取 羊 评分详情
export function getSheepScoreDetail(contestId, rfid) {
  return request({
    url: `/app/vote/sheep/getSheepInfo?contestId=${contestId}&rfid=${rfid}`,
    method: 'get',
  })
}



// ================== 剪羊毛相关 =================

// 获取 选手列表
export function getPersonList(contestId) {
  return request({
    url: `/app/vote/person/getPersonList?contestId=${contestId}`,
    method: 'get',
  })
}

// 提交 选手 评分
export function savePersonScore(data) {
  return request({
    url: `/app/vote/person/savePersonScore`,
    method: 'post',
    data
  })
}

// 选手 评分详情
export function getPersonScoreDetail(contestId, personId) {
  return request({
    url: `/app/vote/person/getPersonInfo?contestId=${contestId}&personId=${personId}`,
    method: 'get'
  })
}

// 获取 评分标准
export function getGuiZe(contestId) {
  return request({
    url: `/app/vote/guiZe/getGuiZe?contestId=${contestId}`,
    method: 'get'
  })
}

// 获取 羊 当前排名
export function getSheepRank(contestId, sheepNumber) {
  return request({
    url: `/app/vote/sheep/getSheepRank?contestId=${contestId}&sheepNumber=${sheepNumber}`,
    method: 'get'
  })
}
